//
//  BBKitTests.m
//  BBKitTests
//
//  Created by apple on 2019/6/28.
//  Copyright © 2019年 baobao. All rights reserved.
//

#import <XCTest/XCTest.h>
#import <EarlGrey/EarlGrey.h>
#import "ViewController.h"


@interface BBKitTests : XCTestCase

@end

@implementation BBKitTests

- (void)setUp {
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
//    [[EarlGrey selectElementWithMatcher:grey_keyWindow()]
//     assertWithMatcher:grey_sufficientlyVisible()];
    /**
     selectElementWithMatcher：元素选择
     performAction：操作
     assertWithMatcher：断言
     inRoot：
     */
//    NSError * error;
//    [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ClickMe")] performAction:grey_tap()] assertWithMatcher:grey_sufficientlyVisible() error:&error];
//    if (error) {
//      NSLog(@"Test Failed with Error : %@",[error description]);
//    }
    [[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"TextCell")] performAction:grey_tap()] assertWithMatcher:grey_sufficientlyVisible()];
//    inRoot:grey_kindOfClass([ViewController class])]
//    performAction:grey_tap()];
}

//找元素
- (void)testBasicSelection {
  // Select the button with Accessibility ID "clickMe".
  [EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ClickMe")];
}
//对元素操作
- (void)testBasicSelectionAndAction {
  // Select and tap the button with Accessibility ID "clickMe".
  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ClickMe")]
      performAction:grey_tap()];
}
//找元素+断言
- (void)testBasicSelectionAndAssert {
  // Select the button with Accessibility ID "clickMe" and assert it's visible.
  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ClickMe")]
      assertWithMatcher:grey_sufficientlyVisible()];
}
//对元素操作+断言
- (void)testBasicSelectionActionAssert {
  // Select and tap the button with Accessibility ID "clickMe", then assert it's visible.
  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ClickMe")]
      performAction:grey_tap()]
      assertWithMatcher:grey_sufficientlyVisible()];
}


//- (void)testPerformanceExample {
//    // This is an example of a performance test case.
//    [self measureBlock:^{
//        // Put the code you want to measure the time of here.
//    }];
//}



@end
